/****************************************************************************
 *
 *  3DSCAMM.H
 *
 *  (C) Copyright 1997 by Autodesk, Inc.
 *
 *  This program is copyrighted by Autodesk, Inc. and is licensed to you under
 *  the following conditions.  You may not distribute or publish the source
 *  code of this program in any form.  You may incorporate this code in object
 *  form in derivative works provided such derivative works are (i.) are de-
 *  signed and intended to work solely with Autodesk, Inc. products, and (ii.)
 *  contain Autodesk's copyright notice "(C) Copyright 1995 by Autodesk, Inc."
 *
 *  AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.  AUTODESK SPE-
 *  CIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR
 *  A PARTICULAR USE.  AUTODESK, INC.  DOES NOT WARRANT THAT THE OPERATION OF
 *  THE PROGRAM WILL BE UNINTERRUPTED OR ERROR FREE.
 *
 ***************************************************************************/

#ifndef CAMM_3DS_H
#define CAMM_3DS_H

#include "3DSTYPE.H"
#include "3DSPRIM.H"
#include "DBASE3DS.H"
#include "CHUNK3DS.H"

#define NoParent3ds -1

/* Public Typedefs */

typedef struct {
  char3ds name[11];    /* Name of camera object */
  char3ds parent[22];  /* Name of parent object */
  
  ushort3ds flags1;    /* flags field from node header -fixup later */
  ushort3ds flags2;    /* flags2 field from node header -fixup later */
  
  ulong3ds npkeys;     /* Number of camera position keys */
  ushort3ds npflag;    /* Loop control flag for camera position keys */
  keyheader3ds *pkeys; /* Spline values for camera position keys */
  point3ds *pos;       /* Camera position keys */
  
  ulong3ds nfkeys;     /* Number of camera FOV keys */
  ushort3ds nfflag;    /* Loop control flag for camera FOV keys */
  keyheader3ds *fkeys; /* Spline values for camera FOV keys */
  float3ds *fov;       /* Camera FOV keys */
  
  ulong3ds nrkeys;     /* Number of camera roll keys */
  ushort3ds nrflag;    /* Loop control flag for camera roll keys */
  keyheader3ds *rkeys; /* Spline values for camera roll keys */
  float3ds *roll;      /* Camera roll keys */
  
  char3ds tparent[22]; /* Index of parent object for target */
  ulong3ds ntkeys;     /* Number of target position keys */
  ushort3ds ntflag;    /* Loop control flag for target position keys */
  keyheader3ds *tkeys; /* Spline values for target position keys */
  point3ds *tpos;      /* Target position keys */
  ushort3ds tflags1;   /* flags field from target node header */
  ushort3ds tflags2;   /* flags field from target node header */
} kfcamera3ds;
/* End Public */

/* Public Prototypes */

#ifdef __cplusplus
extern "C" {
#endif


void InitCameraMotion3ds(kfcamera3ds **cam, ulong3ds npkeys, ulong3ds nfkeys,
                             ulong3ds nrkeys, ulong3ds ntkeys);

void GetCameraMotionByName3ds(database3ds *db, 
			      const char3ds *name, 
			      kfcamera3ds **kfcam);

void GetCameraMotionByIndex3ds(database3ds *db, 
			       ulong3ds index,
			       kfcamera3ds **kfcam);

void PutCameraMotion3ds(database3ds *db, kfcamera3ds *kfcam);


void ReleaseCameraMotion3ds(kfcamera3ds **cam);

ulong3ds GetCameraNodeCount3ds(database3ds *db);

void GetCameraNodeNameList3ds(database3ds *db, namelist3ds **list);

void DeleteCameraMotionByIndex3ds(database3ds *db, ulong3ds index);
void DeleteCameraMotionByName3ds(database3ds *db, char3ds *name);
void CopyCameraMotionByIndex3ds(database3ds *destdb, database3ds *srcdb, ulong3ds index);
void CopyCameraMotionByName3ds(database3ds *destdb, database3ds *srcdb, char3ds *name);

/* End Public */

void GetCameraMotion3ds(chunk3ds *pCamChunk, chunk3ds *pTargetChunk, 
			kfcamera3ds **kfcam);

#ifdef __cplusplus
}
#endif



#endif

